#ifndef _UTIL_FILE_H_
#define _UTIL_FILE_H_

#include "common.h"
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <pthread.h>
#include <sys/time.h>
#include "info_apper.h"

#define ISEXIST_NO              0  
#define ISEXIST_YES             1  
#define OPEN_FILE_ERROR         -1
#define WRITE_FILE_ERROR        -1

    
#define LOCAL_WITH //统计本地带宽

typedef struct {
    int fd[3];
    int thread_id;
} TMFile;

/**创建目录*/
int CreateDir(const char *sPathName);
/** 关闭文件 */
int file_close(FilePro *cfile);
void utils_file_test();
int save_tofile_with_queue(FilePro *cfile, PackWriteFile *pwf, BQueue *queue, uint8 *rdata, uint64 rlen);
#endif